unit Unithelp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, ExtCtrls;

type
  TFhelp1 = class(TForm)
    Image1: TImage;
    sh: TEdit;
    Lusername: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    sbnext: TSpeedButton;
    sbquery: TSpeedButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure sbnextClick(Sender: TObject);
    procedure sbqueryClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Fhelp1: TFhelp1;

implementation
uses
  superobject,ArService,Unitshare;
{$R *.dfm}

procedure TFhelp1.FormClose(Sender: TObject; var Action: TCloseAction);
begin

Action:=caFree;
end;

procedure TFhelp1.sbnextClick(Sender: TObject);
begin
ModalResult:=mrOk;
end;

procedure TFhelp1.sbqueryClick(Sender: TObject);
var
  obj:ISuperObject;
  jsonstr:string;
  str:string;
begin
 jsonstr:=GetIArService().GetCustInfo(sh.Text,False);
 try
obj:=SO(jsonstr);
str:=obj.S['Code'];
except
on e:Exception do
   raise e;
end;
if str<>'200' then
raise Exception.Create(obj.s['Msg']);
sbnext.Visible:=true;
//
Lusername.Caption:=obj['Result'].AsString;
sharedata.taxno:=sh.Text;
sharedata.taxname:=Lusername.Caption;
///

end;

end.
